import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

export type UserDocument = User & Document;

@Schema()
export class User {
  /**
   * 用户唯一标识
   */
  @Prop()
  openid: string;

  /**
   * 昵称
   */
  @Prop()
  nickName: string;

  /**
   * 积分
   */
  @Prop()
  integral: number;
}

export const UserSchema = SchemaFactory.createForClass(User);
